package com.lankystar.sos.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name="sos_userLocation")
public class UserLocation implements Serializable{

	private static final long serialVersionUID = 1L;

	/**
	 * id、经度、纬度、最后更新时间、用户（一对一）
	 */
	private int locatId;
	private double longitude;
	private double latitude;
	private Date lastUpdateTime;
	private User user;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getLocatId() {
		return locatId;
	}
	public void setLocatId(int locatId) {
		this.locatId = locatId;
	}
	public double getLongitude() {
		return longitude;
	}
	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}
	public double getLatitude() {
		return latitude;
	}
	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}
	@Temporal(TemporalType.DATE)
	public Date getLastUpdateTime() {
		return lastUpdateTime;
	}
	public void setLastUpdateTime(Date lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}
	@OneToOne
	@JoinColumn(name = "user_Id")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
}
